
<?php
$conflen=strlen('SCRIPT');
$B=substr(__FILE__,0,strrpos(__FILE__,'/'));
$A=substr($_SERVER['DOCUMENT_ROOT'], strrpos($_SERVER['DOCUMENT_ROOT'], $_SERVER['PHP_SELF']));
$C=substr($B,strlen($A));
$posconf=strlen($C)-$conflen-1;
$D=substr($C,1,$posconf);
$host='http://'.$_SERVER['SERVER_NAME'].'/'.$D;
echo $host;

echo "\n * Doc ROOT * ".$_SERVER['DOCUMENT_ROOT'];

echo "\n PHP SELF ".$_SERVER['PHP_SELF'];


echo "Fist Toeken : ".strtok($_SERVER['PHP_SELF'], '/');



if (isset($_ENV["HOSTNAME"])) 
    $MachineName = $_ENV["HOSTNAME"]; 
else if  (isset($_ENV["COMPUTERNAME"])) 
    $MachineName = $_ENV["COMPUTERNAME"]; 
else $MachineName = "";

echo $_ENV["HOSTNAME"]; 

echo $_ENV["COMPUTERNAME"];

?>